<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			
			/*function foo(){
				bar.apply(null,arguments)
			}
			function bar(){
				console.log(arguments);
			}
			
			foo(1,2,3,4,5);//1,2,3,4,5*/

//this
//1.函数预编译过程 this-->window
//2.全局作用域中，this-->window
//3.call/apply改变this指向
//4.obj.func(), this-->obj
			
			/*function test(){
				console.log(this);
			}*/
			
			
			
			/*var name = "222";
			var a ={
				name: "111",
				say : function (){
					console.log(this.name);
				}
			}
			var fun = a.say;
			fun();///222
			a.say();//111
			var b = {
				name : "333",
				say: function(fun){
					fun();
				}
			}
			
			b.say(a.say);//222
			b.say = a.say;
			b.say();//333*/
			
			
			/*function test(){
				console.log(arguments.callee);
			}
			test();*/
			
			/*var num = (function(n){
				if(n == 1){
					return 1;
				}
				return n * arguments.callee(n - 1);
			}(10));
			console.log(num);*/
			
			/*function test(){
				console.log(arguments.callee);
				function demo(){
					console.log(arguments.callee);
				}
				demo();
			}
			test();*/
			
		/*	var foo = 123;
			function print(){
				this.foo = 234;
				console.log(foo);
			}
//			print();//234
			new print();///123*/
			
			/*var a = 5;
			function test(){
				a = 0;
				alert(a);
				alert(this.a);
				var a;
				alert(a);
			}
			
//			test(); // 0    5   0
			new test();// 0  un  0*/
			
			/*var bar = {a:"002"};
			function print(){
				bar.a = 'a';
				Object.prototype.b = 'b';
				return function inner(){
					console.log(bar.a);
					console.log(bar.b);
				}
			}
			
			print()();//a   b*/
			
			
			
			
			
			
			
		</script>
	</body>
</html>
